package com.dyh.quickdemo.demos.dtdl;

import lombok.AllArgsConstructor;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/*
@Author=Joey Wheeler
@Date=2020/10/19 8:48
*/
@AllArgsConstructor
public class HelloInvocationHandler implements InvocationHandler {

    private Hello target;


    /*
    proxy
      \_handler
           \_hello

    target = BaseHello@5594
    */
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        Object result = method.invoke(target, args);
        return result+"!";
    }
}
